1. Field of the Invention
The present invention relates to a microcomputer provided with a monitor circuit for tracing, i.e., keeping track of operations of a central processing unit (CPU) disposed in the microcomputer.
2. Description of the Prior Art
In order to develop computer systems, it is necessary to implement development work accompanied by verification of whether or not software programs to control operations of the CPU are executed properly. Furthermore, a single chip microcomputer having a built-in monitor circuit for monitoring instructions or the like provided by the CPU has been used recently.
Referring now to FIG. 6, there is illustrated a block diagram showing the structure of such a prior art microcomputer. In the figure, reference numeral 100 denotes a single chip microcomputer, 110 denotes a CPU, 120 denotes a memory for storing a software program for controlling operations of the CPU 110, data and the like, 130 denotes a bus interface unit for linking buses of the CPU 110 to buses of the memory 120, and 140 denotes a monitor unit for keeping track of the execution of an instruction by the CPU 110. Furthermore, reference numeral 150 denotes a tristate buffer, 160 denotes a flag register for storing a flag determining whether or not the monitor unit keeps track of operations of the CPU, 170 denotes a storage unit for storing trace information obtained by the monitor unit 140, and 180 denotes an external terminal through which a signal for setting the flag in the flag register 160 is applied to the flag register 160 from outside the microcomputer. In addition, reference numeral 191 denotes a data bus, 192 denotes an address bus, 193 denotes a group of control signal lines, 194 denotes a CPU data bus, and 195 denotes a CPU address bus.
Next, a description will be made as to the operation of the prior art microcomputer. The monitor unit 140 can latch signals on the CPU address bus 195 and CPU data bus 194 connecting the CPU 110 to the bus interface unit 130 according to a signal on the group 193 of control signal lines and furnish a piece of trace information about the type of an instruction executed by the CPU 110, the address specifying a memory location in the memory in which the instruction is stored and data processed by the instruction. When the flag register 160 is set to "High" state by way of the external terminal 180, that is, when the monitor unit is allowed to store such a piece of trace information in the storage unit 170, the trace information furnished by the monitor unit 140 is written into the storage unit 170 by way of the tristate buffer 150. When the summation of all pieces of trace information sequentially stored in the storage unit exceeds the storage capacity of the storage unit 170, the oldest piece of trace information is erased so that a new piece of trace information can be stored in the storage unit. On the other hand, when the flag register 160 is set to "Low" state, a piece of trace information from the monitor unit 140 cannot be stored in the storage unit 170.
Therefore, a problem with such a prior art microcomputer having the structure mentioned above is that in order to check the main stream of an operation of a software program, that is, check the operation of the program from a broad perspective, the amount of information to be traced is increased and therefore a storage unit having a large amount of memory is needed.